﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Enter.BizLogic;
using Enter.Entity;
using Enter.Config;

namespace Enter.Services.Mail
{
    public partial class Mail : IMail
    {
        public string GetShopNo()
        {
            int num = new Random().Next(100, 0x270f);
            return "s" + "-" + DateTime.Now.ToString("yyMMddHHmmss") + "-" + DateTime.Now.Millisecond.ToString() + "-" + num.ToString();
           
        }

        /// <summary> 
        /// 申请开店
        /// </summary>
        /// <param name="Entity"></param>
        /// <returns></returns>
        public bool AddShop(T401_ShopEntity Entity, T402_ShopInfoEntity Entityinfo)
        {
            T401_ShopBLLSub bll = new T401_ShopBLLSub();

            return bll.Insert(Entity, Entityinfo);
        }
        /// <summary>
        /// 修改店铺基本信息
        /// </summary>
        /// <param name="Entity"></param>
        /// <returns></returns>
        public bool UpdateShop(T401_ShopEntity Entity)
        {
            T401_ShopBLLSub bll = new T401_ShopBLLSub();
            return bll.Update(Entity);
        }
        /// <summary>
        /// 修改店铺详细信息
        /// </summary>
        /// <param name="Entity"></param>
        /// <returns></returns>
        public bool UpdateShopInfo(T402_ShopInfoEntity Entity)
        {
            T402_ShopInfoBLLSub bll = new T402_ShopInfoBLLSub();
            return bll.Save(Entity);
        }
        /// <summary>
        /// 通过店铺ID获取店铺基本信息
        /// </summary>
        /// <param name="shopID"></param>
        /// <returns></returns>
        public T401_ShopEntity GetShopByID(int shopID)
        {
            T401_ShopBLLSub bll = new T401_ShopBLLSub();
          return  bll.GetObjectBySID(shopID);
        }
        /// <summary>
        /// 通过店铺NO获取店铺基本信息
        /// </summary>
        /// <param name="shopID"></param>
        /// <returns></returns>
        public T401_ShopEntity GetShopBySNO(string sNO)
        {
            T401_ShopBLLSub bll = new T401_ShopBLLSub();
            return bll.GetObjectBySNO(sNO);
        }
        /// <summary>
        /// 通过用户ID获取店铺基本信息
        /// </summary>
        /// <param name="uID"></param>
        /// <returns></returns>
        public T401_ShopEntity GetShopByUID(int uID)
        {
            T401_ShopBLLSub bll = new T401_ShopBLLSub();
            return bll.GetObjectByUID(uID);
        }
        /// <summary>
        /// 通过店铺ID获取店铺详细信息
        /// </summary>
        /// <param name="shopID"></param>
        /// <returns></returns>
        public T402_ShopInfoEntity GetShopInfoByID(int shopID)
        {
            T402_ShopInfoBLLSub bll = new T402_ShopInfoBLLSub();
            return bll.GetObjectBySID(shopID);
        }
        /// <summary>
        /// 添加店铺自定义商品类型
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        public bool AddShopGoodClass(T405_ShopGoodClassEntity entity)
        {
            T405_ShopGoodClassBLLSub bll = new T405_ShopGoodClassBLLSub();
            return bll.Save(entity);
        }

        /// <summary>
        /// 添加店铺自定义商品类型
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        public bool UpdateShopGoodClass(T405_ShopGoodClassEntity entity)
        {
            T405_ShopGoodClassBLLSub bll = new T405_ShopGoodClassBLLSub();
            return bll.Save(entity);
        }

        /// <summary>
        /// 获取店铺自定义类型
        /// </summary>
        /// <param name="shopID"></param>
        /// <returns></returns>
        public List<T405_ShopGoodClassEntity> GetShopGoodClassByShopID(int shopID)
        {
            T405_ShopGoodClassBLLSub bll = new T405_ShopGoodClassBLLSub();
            return bll.GetShopGoodClassByShopID(shopID);
        }
        /// <summary>
        /// 获取店铺自定义类型
        /// </summary>
        /// <param name="shopID"></param>
        /// <returns></returns>
        public List<T405_ShopGoodClassEntity> GetShopGoodClassByShopID(int shopID, EnumStatus status)
        {
            T405_ShopGoodClassBLLSub bll = new T405_ShopGoodClassBLLSub();
            return bll.GetShopGoodClassByShopID(shopID, status);
        }
        /// <summary>
        /// 获取店铺自定义类型
        /// </summary>
        /// <param name="shopID"></param>
        /// <returns></returns>
        public List<T405_ShopGoodClassEntity> GetShopGoodClassByParentID(int shopID, int parentID)
        {
            T405_ShopGoodClassBLLSub bll = new T405_ShopGoodClassBLLSub();
            return bll.GetShopGoodClassByParentID(shopID, parentID);
        }
        /// <summary>
        /// 获取店铺自定义类型
        /// </summary>
        /// <param name="shopID"></param>
        /// <returns></returns>
        public List<T405_ShopGoodClassEntity> GetShopGoodClassByParentID(int shopID, int parentID, EnumStatus status)
        {
            T405_ShopGoodClassBLLSub bll = new T405_ShopGoodClassBLLSub();
            return bll.GetShopGoodClassByParentID(shopID, parentID, status);
        }
    }
}
